#include<iostream>
#include"my_tree.h"

using namespace std;

/*
                0
        1       2       3
     4  5  6  7
*/
//0 1 4 5 6 2 7 3 
 
int main(){
	my_tree<int> Tree(0);
//	cout<<Tree;
	TreeNode<int> node1(1,0,-1,-1); 
	TreeNode<int> node2(2,0,-1,-1);
	TreeNode<int> node3(3,0,-1,-1);
	TreeNode<int> node4(4,1,-1,-1);
	TreeNode<int> node5(5,1,-1,-1);
	TreeNode<int> node6(6,1,-1,-1);
	TreeNode<int> node7(7,2,-1,-1);
	Tree.insert(node1);
	Tree.insert(node2);
	Tree.insert(node3);
	Tree.insert(node4);
	Tree.insert(node5);
	Tree.insert(node6);
	Tree.insert(node7);
//	cout<<Tree;
//	Tree.show_binary_tree("first_root");
//	Tree.show_binary_tree_with_root("last_root",0);
//	cout<<Tree.get_root();
//	Tree.show_binary_tree("first_root");
//	Tree.show_binary_tree("last_root");
//	Tree.show_binary_tree("layer_first");
//	Tree.traversal_binary_tree("first_root",print);	
//	auto bound_func=bind(
//		static_cast<void(*) (my_tree<int>,int)>(print_node),
//		ref(Tree),
//		placeholders::_1
//	);
//	Tree.traversal_binary_tree("first_root",bound_func);	
//	Tree.traversal_binary_tree("last_root",bound_func);	
//	Tree.traversal_binary_tree("layer_first",bound_func);	
//	cout<<Tree[0]<<Tree[1]<<Tree[2]<<Tree[3]<<Tree[4]<<Tree[5]<<Tree[6]<<Tree[7]; 
//	cout<<Tree.get_height();
//	cout<<Tree.get_h_layer_nodes(1)<<endl;
//	cout<<Tree.get_h_layer_nodes(2)<<endl;
//	cout<<Tree.get_h_layer_nodes(3)<<endl;
//	cout<<Tree.get_last_layer_nodes()<<endl;
	my_union_tree<int> u(0);
	cout<<node1<<endl;
	u.insert(node1);
	u.insert(node2);
	u.insert(node3);
	u.insert(node4);
	u.insert(node5);
	u.insert(node6);
	u.insert(node7);
	cout<<u<<endl;
	
	return 0;
}
















